<%--
  Created by IntelliJ IDEA.
  User: kadsg
  Date: 2023/1/6
  Time: 18:18
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>系统用户</title>
</head>
<body>
    <jsp:include page="../../head/manager.jsp"/>
    <div class="container">
      <form action="${pageContext.request.contextPath}/RQueryAllByIdController" method="get">
        <div class="form-group">
          <div class="col-sm-4">
            <div class="input-group ms-end">
              <input type="text" class="form-control" name="id">
              <button type="submit" class="btn btn-primary">按读者id搜索</button>
            </div>
          </div>
        </div>
      </form>
    </div>
    <div class="container">
      <form action="${pageContext.request.contextPath}/RQueryAllByNameController" method="get">
        <div class="form-group">
          <div class="col-sm-4">
            <div class="input-group ms-end">
              <input type="text" class="form-control" name="name">
              <button type="submit" class="btn btn-primary">按读者姓名搜索</button>
            </div>
          </div>
        </div>
      </form>
    </div>
    <div class="accordion accordion-flush" id="accordionFlushExample">

      <div class="accordion-item">
        <h2 class="accordion-header unUsed">
          <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
                  data-bs-target="#unUsed" aria-expanded="false" aria-controls="unUsed">
            系统用户
          </button>
        </h2>
        <div id="unUsed" class="accordion-collapse collapse" aria-labelledby="unUsed"
             data-bs-parent="#accordionFlushExample">
          <div class="accordion-body">
            <c:if test="${readerList == null}">
              无用户！
            </c:if>
            <c:if test="${readerList != null}">
              <table class="table table-hover">
                <tbody>
                <tr>
                  <th>账号</th>
                  <th>姓名</th>
                  <th>联系方式</th>
                  <th>邮箱</th>
                </tr>
                <c:forEach items="${readerList}" var="reader">
                  <tr>
                    <td>${reader.id}</td>
                    <td>${reader.name}</td>
                    <td>${reader.phone}</td>
                    <td>${reader.address}</td>
                  </tr>
                </c:forEach>
                </tbody>
              </table>
            </c:if>
          </div>
        </div>
      </div>
      </div>
</body>
</html>
